-- GENERATED SPELL FOR [Araj the Summoner] --


function spell0_1852(pUnit, Event) --@Araj\'s Phylactery,n/a--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(18661,pUnit:GetMainTank ())
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_1852', 1, 1)
end

function spell1_1852(pUnit, Event) --@Frost Nova,Self--
pUnit:FullCastSpellOnTarget(15532,pUnit)
pUnit:RegisterEvent('Sorts_1852', 8250, 1)
end

function spell2_1852(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(15497,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_1852', 7000, 1)
end

function spell3_1852(pUnit, Event) --@Summon Illusory Wraith,Self--
pUnit:FullCastSpellOnTarget(17231,pUnit)
pUnit:RegisterEvent('Sorts_1852', 1000, 1)
end

function Sorts_1852(pUnit, Event)
local choix_sorts_1852 = math.random(0, 3)
if choix_sorts_1852 == 0 then
pUnit:RegisterEvent('spell0_1852', 1, 1)
end
if choix_sorts_1852 == 1 then
pUnit:RegisterEvent('spell1_1852', 1, 1)
end
if choix_sorts_1852 == 2 then
pUnit:RegisterEvent('spell2_1852', 1, 1)
end
if choix_sorts_1852 == 3 then
pUnit:RegisterEvent('spell3_1852', 1, 1)
end
end

function mob1852_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_1852', math.random(1500, 3000), 1)
end

function mob1852_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob1852_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob1852_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(1852, 1, 'mob1852_Action')
RegisterUnitEvent(1852, 2, 'mob1852_Leave')
RegisterUnitEvent(1852, 3, 'mob1852_Kill')
RegisterUnitEvent(1852, 4, 'mob1852_Die')
